package lanqiao;
/**
 * @Project : AlgorithmLearning
 * @Package : LanQiao.PrepareForCompetition
 * @File : Q1449.java
 * @Author : WangRuoyu
 * @Date : 2023/3/29 9:16
 */

import java.util.ArrayList;

public class Q1449 {
    public static void main(String[] args) {
        int xlen = 20;
        int ylen = 21;

        ArrayList<double[]> list = new ArrayList<>();
        int[][] point = new int[xlen * ylen][2];
        for (int i = 0; i < xlen; i++) {
            for (int j = 0; j < ylen; j++) {
                point[i * ylen + j][0] = i;
                point[i * ylen + j][1] = j;
            }
        }
        for (int i = 0; i < point.length; i++) {
            for (int j = 0; j < point.length; j++) {
                if (i != j) {
                    String str = "";
                    int x1 = point[i][0];
                    int x2 = point[j][0];
                    int y1 = point[i][1];
                    int y2 = point[j][1];
                    if (x1 != x2) {
                        list.add(new double[]{(double) (y1 - y2) / (x1 - x2), (double) (x1 * y2 - x2 * y1) / (x1 - x2)});
                    }
                }
            }
        }
        list.sort((o1, o2) -> (o1[0] != o2[0] ? (Double.compare(o1[0], o2[0])) : (Double.compare(o1[1], o2[1]))));
        int res = 1;
        for (int i = 1; i < list.size(); ++i) {
            if (list.get(i)[0] - list.get(i - 1)[0] > 1e-8 || list.get(i)[1] - list.get(i - 1)[1] > 1e-8) {
                res++;
            }
        }
        System.out.println(res + xlen);
    }
}

// 哈希表存字符串，TLE
//public class Q1449 {
//    static int gcd(int a, int b) {
//        return b == 0 ? a : gcd(b, a % b);
//    }
//
//    public static void main(String[] args) {
//        int xlen = 20;
//        int ylen = 21;
//
//        HashSet<String> set = new HashSet<>();
//        int[][] point = new int[xlen * ylen][2];
//        for (int i = 0; i < xlen; i++) {
//            for (int j = 0; j < ylen; j++) {
//                point[i * ylen + j][0] = i;
//                point[i * ylen + j][1] = j;
//            }
//        }
//        for (int i = 0; i < point.length; i++) {
//            for (int j = 0; j < point.length; j++) {
//                if (i != j) {
//                    String str = "";
//                    int x1 = point[i][0];
//                    int x2 = point[j][0];
//                    int y1 = point[i][1];
//                    int y2 = point[j][1];
//                    if (x1 != x2) {
//                        double k = ((double) (y1 - y2) / (x1 - x2)) + 0.0;
//                        str += String.format("%.8f", k) + "#";
//                        double b = ((double) (x1 * y2 - x2 * y1) / (x1 - x2)) + 0.0;
//                        str += String.format("%.8f", b);
//                        set.add(str);
//                    }
//                }
//            }
//        }
//        System.out.println(set.size() + xlen);
//    }
//}